<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise</title>
</head>
<body>
    <script>
        //实例化
        const p = new Promise(function(resolve,reject){
           setTimeout(()=>{
                let data = '数据库中的用户数据';
                resolve(data);
           },1000)
        });
        
      
       p.then((value)=>{
            console.log(value);        
       },(reason)=>{
            console.log(reason);
       })
    </script>
</body>
</html>